package com.woniu.inlet.web.command;

import com.woniu.service.domain.RiskDto;
import com.woniu.utils.ApplicationContextHolder;
import lombok.Data;

@Data
public class RiskCommand {
    private Integer userId;//用户id
    private Integer score;
    private RiskCommandHandle handle;

    public RiskCommand() {
        this.handle = ApplicationContextHolder.getApplicationContext().getBean(RiskCommandHandle.class);
    }

    public RiskCommand(Integer userId, Integer score) {
        this();
        this.userId = userId;
        this.score = score;
    }

    public RiskDto execute() {
        return handle.action(this);
    }

}
